<?php
/**
 * Created by PhpStorm.
 * User: Daniel
 * Date: 2017/12/17
 * Time: 11:06
 */

/* @var $this yii\web\View */
/* @var $form yii\bootstrap\ActiveForm */
/* @var $model app\models\LoginForm */

use yii\helpers\Html;
use yii\bootstrap\ActiveForm;

?>

<ol class="breadcrumb">
    <li><a href="/site/index">设备列表</a></li>
    <li><a href="/site/info?deviceId=<?php echo $deviceId?>&deviceName=<?= @urlencode($_GET['deviceName']) ?>">设备:<?= $_GET['deviceName'] ?></a></li>
    <li class="active">数据报表</li>
</ol>

<!-- Start right Content here -->
<!-- DataTables -->
<style>
    .footer{
        display: none;
    }
    .dt-buttons{
        float: right;
    }

    #datatable-buttons_filter {
        text-align: left;
    }
</style>


<link href="assets/plugins/datatables/jquery.dataTables.min.css" rel="stylesheet" type="text/css" />

<div class="row">
<div class="col-md-12">
<div class="panel panel-primary">
<div class="panel-body">
    <h4 class="m-b-30 m-t-0">设备编号:<?= @$_GET['deviceName'] ?></h4>
    <form class="form-inline" role="form" style="margin-bottom: 10px;">
        <div class="form-group hidden">
            <input type="text" class="form-control" name="deviceId" value="<?php echo $deviceId?>"/>
        </div>

        <div class="form-group">
            <div class="input-daterange input-group" id="date-range" >
                <input type="date" class="form-control" name="start" value="<?php echo $start?>"/>
                <span class="input-group-addon bg-primary text-white b-0">to</span>
                <input type="date" class="form-control" name="end" value="<?php echo $end?>"/>
            </div>
        </div>

        <div class="form-group">
            <div class="col-sm-10">
                <select class="form-control" name="switchNum">
                    <?php echo $switchNum ?>
                </select>
            </div>
        </div>
        <button type="submit" class="btn btn-success waves-effect waves-light m-l-10">确 定</button>
    </form>
<table id="datatable-buttons" class="table table-striped table-bordered">
<thead>
<tr>
    <th>数据采集时间</th>
    <th>工作模式</th>
    <th>油位百分比</th>
    <th>有效油位百分比</th>
    <th> 油位上限值</th>
    <th> 油位下限值</th>
    <th> 累计工作时间</th>
    <th> 累计开机次数</th>
</tr>
</thead>

<tbody>

<?php foreach ($list as $info): ?>
    <tr>
        <td><?= $info['uploadTime'] ?></td>
        <td><?= $info['mode'] ?></td>
        <td><?= $info['rate'] ?></td>
        <td><?= $info['frate'] ?></td>
        <td><?= $info['up'] ?></td>
        <td><?= $info['low'] ?></td>
        <td><?= $info['workingTime'] ?></td>
        <td><?= $info['openTimes'] ?></td>
    </tr>
<?php endforeach; ?>
</tbody>
</table>

</div>
</div>
</div>

</div> <!-- End Row -->

<script src="assets/js/jquery.min.js"></script>

<!-- Datatables-->
<script src="assets/plugins/datatables/jquery.dataTables.min.js"></script>
<script src="assets/plugins/datatables/dataTables.bootstrap.js"></script>
<script src="assets/plugins/datatables/dataTables.buttons.min.js"></script>
<script src="assets/plugins/datatables/buttons.bootstrap.min.js"></script>
<script src="assets/plugins/datatables/jszip.min.js"></script>
<script src="assets/plugins/datatables/pdfmake.min.js"></script>
<script src="assets/plugins/datatables/vfs_fonts.js"></script>
<script src="assets/plugins/datatables/buttons.html5.min.js"></script>
<script src="assets/plugins/datatables/buttons.print.min.js"></script>
<script src="assets/plugins/datatables/dataTables.fixedHeader.min.js"></script>
<script src="assets/plugins/datatables/dataTables.keyTable.min.js"></script>
<script src="assets/plugins/datatables/dataTables.responsive.min.js"></script>
<script src="assets/plugins/datatables/responsive.bootstrap.min.js"></script>
<script src="assets/plugins/datatables/dataTables.scroller.min.js"></script>

<!-- Datatable init js -->
<script src="assets/pages/datatables.init.js"></script>



<!-- End Right content here -->
